package com.sunfeng.chap2.p20;

import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.file.StandardOpenOption;

/**
 * @Author : 孙峰
 * @Description:
 * @Date : 2021/10/11  10:22
 */
public class OpenMethod2Param_3 {
    public static void main(String[] args) throws IOException {
        File file = new File("d:\\nio\\aaaa.txt");
        FileChannel fileChannel = FileChannel.open(file.toPath(), StandardOpenOption.APPEND);
        fileChannel.write(ByteBuffer.wrap("123".getBytes()));
        fileChannel.close();
    }
}
